package com.pro.controller;

import com.pro.pojo.JsBeforeUser;
import com.pro.pojo.JsClosure;
import com.pro.pojo.JsUserDevelopment;
import com.pro.pojo.JsonData;
import com.pro.service.JsBeforeUserServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/JsBeforeUser")
public class JsBeforeUserController {

    @Autowired
    private JsBeforeUserServcie jus;

    //获取所有用户
    @RequestMapping("/getJsBeforeUser")
    @ResponseBody
    public JsonData getJsBeforeUser(JsBeforeUser jsBeforeUser){
        List<JsBeforeUser> jsBeforeUser1 = jus.getJsBeforeUser(jsBeforeUser);
        return jsBeforeUser1 != null?JsonData.buildSuccess(jsBeforeUser1):JsonData.buildError("服务器出错了");
    }

    //高级检索获取所有用户
    @RequestMapping("/getJsBeforeUserRetrieval")
    @ResponseBody
    public JsonData getJsBeforeUserRetrieval(JsBeforeUser jsBeforeUser){
        List<JsBeforeUser> jsBeforeUser1 = jus.getJsBeforeUserRetrieval(jsBeforeUser);
        return jsBeforeUser1 != null?JsonData.buildSuccess(jsBeforeUser1):JsonData.buildError("服务器出错了");
    }

    //修改用户状态
    @RequestMapping("/updateJsBeforeUserStatus")
    @ResponseBody
    public JsonData updateJsBeforeUserStatus(JsBeforeUser jsBeforeUser){
        boolean b = jus.updateJsBeforeUserStatus(jsBeforeUser);
        return b?JsonData.buildSuccess(b):JsonData.buildError("服务器出错了");
    }

    //修改用户
    @RequestMapping("/updateJsBeforeUser")
    @ResponseBody
    public JsonData updateJsBeforeUser(JsBeforeUser jsBeforeUser){
        boolean b = jus.updateJsBeforeUser(jsBeforeUser);
        return b?JsonData.buildSuccess(b):JsonData.buildError("服务器出错了");
    }

    //封停用户
    @RequestMapping("/shutdowmJsBeforeUser")
    @ResponseBody
    public JsonData shutdowmJsBeforeUser(JsBeforeUser jsBeforeUser){
        boolean b = jus.shutdowmJsBeforeUser(jsBeforeUser);
        return b?JsonData.buildSuccess(b):JsonData.buildError("服务器出错了");
    }

    //添加用户
    @RequestMapping("/addJsBeforeUser")
    @ResponseBody
    public JsonData addJsBeforeUser(JsBeforeUser jsBeforeUser){
        boolean b = jus.addJsBeforeUser(jsBeforeUser);
        return b?JsonData.buildSuccess(b):JsonData.buildError("服务器出错了");
    }

    //获取用户id
    @RequestMapping("/getJsBeforeUserId")
    @ResponseBody
    public JsonData getJsBeforeUserId(JsBeforeUser jsBeforeUser){
        JsBeforeUser jsBeforeUserId = jus.getJsBeforeUserId(jsBeforeUser);
        return jsBeforeUserId!=null?JsonData.buildSuccess(jsBeforeUserId):JsonData.buildError("服务器出错了");
    }

    //添加进思用户
    @RequestMapping("/addJsUserDevelopment")
    @ResponseBody
    public JsonData addJsUserDevelopment(JsUserDevelopment jsUserDevelopment){
        boolean b = jus.addJsUserDevelopment(jsUserDevelopment);
        return b?JsonData.buildSuccess(b):JsonData.buildError("服务器出错了");
    }

    //获取非进思用户
    @RequestMapping("/getUnJsUserDevelopment")
    @ResponseBody
    public JsonData getUnJsUserDevelopment(JsBeforeUser jsBeforeUser){
        List<JsBeforeUser> unJsUserDevelopment = jus.getUnJsUserDevelopment(jsBeforeUser);
        return unJsUserDevelopment!=null?JsonData.buildSuccess(unJsUserDevelopment):JsonData.buildError("服务器出错了");
    }

    //非进思用户高级检索
    @RequestMapping("/getUnJsBeforeUserRetrieval")
    @ResponseBody
    public JsonData getUnJsBeforeUserRetrieval(JsBeforeUser jsBeforeUser){
        List<JsBeforeUser> unJsUserDevelopment = jus.getUnJsBeforeUserRetrieval(jsBeforeUser);
        return unJsUserDevelopment!=null?JsonData.buildSuccess(unJsUserDevelopment):JsonData.buildError("服务器出错了");
    }

    //零消费用户列表
    @RequestMapping("/getZeroJsBeforeUser")
    @ResponseBody
    public JsonData getZeroJsBeforeUser(JsBeforeUser jsBeforeUser){
        List<JsBeforeUser> unJsUserDevelopment = jus.getZeroJsBeforeUser(jsBeforeUser);
        return unJsUserDevelopment!=null?JsonData.buildSuccess(unJsUserDevelopment):JsonData.buildError("服务器出错了");
    }

    //零消费用户列表
    @RequestMapping("/getZeroJsBeforeUserRetrieval")
    @ResponseBody
    public JsonData getZeroJsBeforeUserRetrieval(JsBeforeUser jsBeforeUser){
        List<JsBeforeUser> unJsUserDevelopment = jus.getZeroJsBeforeUserRetrieval(jsBeforeUser);
        return unJsUserDevelopment!=null?JsonData.buildSuccess(unJsUserDevelopment):JsonData.buildError("服务器出错了");
    }

}
